package com.hzya.frame.testApplication.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.entity.BaseResult;
import com.hzya.frame.entity.JsonResultEntity;
import com.hzya.frame.testApplication.dao.ITestApplicationDao;
import com.hzya.frame.testApplication.entity.TestApplicationEntity;
import com.hzya.frame.testApplication.service.ITestApplicationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service(value = "testApplicationService")
public class TestApplicationServiceImpl implements ITestApplicationService {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Resource
    private ITestApplicationDao testApplicationDao;

    @Override
    public JsonResultEntity testApplication(JSONObject jsonObject) {
        logger.info("testApplication{}","qweqwe");
        logger.error("testApplication{},参数{}","qweqwe","12312312");
        TestApplicationEntity testApplicationEntity = new TestApplicationEntity();
        testApplicationEntity.setValue("名字");
       List<TestApplicationEntity> testApplicationEntities =  testApplicationDao.queryAll(testApplicationEntity);
        return BaseResult.getSuccessMessageEntity("testApplication",testApplicationEntities);
    }
}
